package com.mlyol.singleton;

public class Demo7 {
    public static void main(String[] args) {
        Singleton instance = Demo7.getInstance();
        Singleton instance2 = Demo7.getInstance();
        System.out.println(instance==instance2);
    }

    static class Singleton {
        public static Singleton singleton = new Singleton();
    }

    private Demo7() {

    }

    public static Singleton getInstance() {
        return Singleton.singleton;
    }

}
